#ifndef LFMCRYPTER_H
#define LFMCRYPTER_H

// #define ENABLE_KEYCZAR

#include<QString>

#ifdef ENABLE_KEYCZAR
#include<keyczar/keyczar.h>
#endif
#ifndef ENABLE_KEYCZAR
#include<QtCrypto/QtCrypto>
#endif

class LFMCrypter{
public:
	LFMCrypter();
	~LFMCrypter();
	
	QString encrypt(const QString &data);
	QString decrypt(const QString &data);
	
	void encryptToFile(const QString &data, const QString &filename);
	QString decryptFromFile(const QString &filename);
private:
#ifdef ENABLE_KEYCZAR
	keyczar::Keyczar* m_crypter;
#endif
#ifndef ENABLE_KEYCZAR
	QCA::Initializer m_qcaInitializer;
	QCA::SymmetricKey *m_key;
	QCA::InitializationVector *m_iv;
	QCA::Cipher *m_cipher;
#endif
};

#endif
